import _00GraphFuc as gf
import _00GraphTreeFuc as gt

#随机生成每个字符的频率表，用Huffmantree(W)构建霍夫曼树tree，用HuffmanCoding生成霍夫曼编码表
V=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w',
   'x','y','z']
W=gt.frequencylist(V)
W=sorted(W)
tree=gt.Huffmantree(W)
codelist=gt.HuffmanCoding(tree)
gtree =gt.Huffmantree2graph(tree)
gf.drawgraph(gtree)
print("W",W)
print("tree",tree)
print("codelist",codelist)